import React from 'react';
import { reviewStatus } from '@/utils/data';

const Project = (props) => {
  const { relationProjects = [] } = props;
  return (
    <div className="dashboard-project">
      <div className="chart-title">
        <div style={{ marginRight: '134px' }}>项目名称</div>
        <div style={{ marginRight: '206px' }}>分支名称</div>
        <div>代码查验状态</div>
      </div>
      <div className="chart-relation-box">
        {relationProjects.map((item) => (
          <div className="chart-relation flex" key={item._id}>
            <div className="chart-project-name">{item.project_name}</div>
            <div>
              <div className="chart-branch-box flex">
                <div className="chart-branch-name">{item.branch}</div>
                <div className={`chart-review-${item.review_status as number} chart-review`}>{reviewStatus.filter((i) => i.value === item.review_status)[0].label}</div>
              </div>
            </div>
          </div>
        ))}
      </div>
    </div>
  );
};

export default Project;
